package com.ubank.accountquery;


import com.ubank.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

public class UBankActivity extends Activity {
    /** Called when the activity is first created. */
	Spinner account_type;
	Spinner account_num;
	ArrayAdapter<String> account_type_adapter;
	ArrayAdapter<String> account_num_adapter;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.account_select);
        account_type=(Spinner)findViewById(R.id.account_select_account_type);
        account_num=(Spinner)findViewById(R.id.account_select_account_num);
        initAdapter();
    }
    
    public void initAdapter() {
    	String[] types={"type1","type2"};
    	String[] nums={"123","321"};
		account_type_adapter=new ArrayAdapter<String>(UBankActivity.this,android.R.layout.simple_spinner_item,types);
		account_type_adapter.setDropDownViewResource(android.R.layout.simple_spinner_item);
		account_type.setAdapter(account_type_adapter);
		account_num_adapter=new ArrayAdapter<String>(UBankActivity.this,android.R.layout.simple_spinner_item,nums);
		account_num_adapter.setDropDownViewResource(android.R.layout.simple_spinner_item);
		account_num.setAdapter(account_num_adapter);
	}
    
    public void accountConfirm(View view) {
		Intent _it=new Intent(this, AccountQuery.class);
		_it.putExtra("account_type", account_type.getAdapter().getItem(account_type.getSelectedItemPosition()).toString());
		_it.putExtra("account_num", account_num.getAdapter().getItem(account_num.getSelectedItemPosition()).toString());
		startActivity(_it);
	}
    
    
}